<template>
        <div class="page">
            <div class="navbar">
            <div class="navbar-inner sliding">
                <div class="left">
                    <a href="#" class="link back">
                        <i class="icon icon-back"></i>
                        <span class="ios-only">返回</span>
                    </a>
                </div>
                <div class="title">我的应用</div>
            </div>
            </div>
            <div class="page-content">
                {{name}}
                <ul>
                    {{#each like}}
                    <li>{{this}}</li>
                    {{/each}}
                </ul>
            </div>
        </div>
    </template>
<style>

</style>
<script>
    return {
        created() {
            // console.log('componentCreated', this)
        },
        mounted() {
            // console.log('$root :', this.$root)
            // this.$setState({
            //     name: 'biaochen',
            //     like: ['biaochen', 'biao', 'chen']
            // });

        },
        beforeDestroy() {
            // console.log('componentBeforeDestroy', this);
        },
        // Component Data
        data: function() {
            // Must return an object
            return {
                name: 'Jimmy',
                like: ['Tennis', 'Chess', 'Football'],
            }
        },
        // Component Methods
        methods: {
            // openAlert: function() {
            //     var self = this;
            //     self.$app.dialog.alert('Hello World');
            // },
        },
        // Page Events
        on: {
            pageMounted: function(e, page) {
                // console.log('pageMounted', page);
            },
            pageInit: function(e, page) {
                // console.log('pageInit', page);

                var self = this
                setTimeout(function() {
                    // self.name = 'chen biao'
                    self.$setState({
                        name: 'biaochen',
                        like: ['biaochen', 'biao', 'chen']
                    });
                    // console.log('self.name :', self.name)
                }, 1000);
            },
        }
    }
</script>